<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>获取字符串长度</title>
<script language="javascript" type="text/javascript">
  var str1="十月一日是国庆节";
  var str2="this is a string";
  alert("str1的长度是："+str1.length+"\nstr2的长度是："+str2.length);
</script>
</head>

<body>
</body>
</html>
